#include "StdAfx.h"

#include "SimpleFile.h"
#include "CustomException.h"

CSimpleFile::CSimpleFile(LPCTSTR stzFileName, LPCTSTR stzOpenMode)
: m_file(NULL)
{
	m_file = fopen(stzFileName, stzOpenMode);
	if(m_file == NULL)
		throw CCustomException(_T("can not open file (%s)"), stzFileName);
}

CSimpleFile::~CSimpleFile()
{
	fclose(m_file);
}

CSimpleFile::operator FILE* ()
{
	return m_file;
}

